/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2021年5月23日
 */
package com.massyframework.beanskin.graphql.context;

/**
 * {@link GraphQLContextAttributes}, GraphQL上下文变量
 * @author huangkh
 *
 */
public interface GraphQLContextAttributes {

	/**
	 * 按{@code name}获取属性
	 * @param name {@link String}
	 * @return {@link Object}, 属性不存在，可返回null.
	 */
	Object getAttribute(String name);
	
	/**
	 * 按{@code name}获取属性
	 * @param <T>
	 * @param name {@link name},属性名
	 * @param attrType {@link Class},属性类型
	 * @return {@link T},属性不存在，可返回null.
	 */
	<T> T getAttribute(String name, Class<T> attrType);
	
	/**
	 * 设置属性
	 * @param name {@link String}， 属性名
	 * @param value {@link Object}, 属性值
	 */
	void setAttribute(String name, Object value);
}
